<div>
    <hr>
    <ul class="breadcrumb">
        <li>
            <a href="#">作品</a> <span class="divider">|</span>
        </li>
        <li>
            <a href="#">编辑</a>
        </li>
    </ul>
    <hr>
</div>
<div class="row-fluid sortable">
    <div class="box span12">
        <div class="box-header" data-original-title>
            <h2><i class="icon-edit"></i><span class="break"></span>作品</h2>
            <div class="box-icon">
                <a href="#" class="btn-setting"><i class="icon-wrench"></i></a>
                <a href="#" class="btn-minimize"><i class="icon-chevron-up"></i></a>
                <a href="#" class="btn-close"><i class="icon-remove"></i></a>
            </div>
        </div>
        <div class="box-content">
            <form class="form-horizontal"  action="<?php echo url('product/edit'); ?>" method="post" id="editForm">
                <fieldset>
                    <div class="control-group">
                        <label class="control-label" for="typeahead">作品名称 </label>
                        <div class="controls">                                
                            <input type="text" class="required" name="p[name]" value="<?php echo $product['name']; ?>"  />
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="typeahead">作品分类 </label>
                        <div class="controls">
                            <?php echo fetch('categorySelect', array('name' => 'p[categoryID]', 'parentID' => $product['categoryID'], 'currentID' => $product['categoryID'])); ?> 
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="fileInput">封面图片</label>
                        <div class="controls">
                            <?php echo fetch('uploadImg', array('images' => $images,'limit'=>1)); ?> 
                        </div>
					</div>
					<div class="control-group">
                        <label class="control-label" for="typeahead">下载链接</label>
                        <div class="controls">
                            <input type="text" class="span6 typeahead required" id="typeahead" name="p[download]" value="<?php echo $product['download'];?>" >
                        </div>
                    </div>
					<div class="control-group">
                        <label class="control-label" for="typeahead">关联标签</label>
                        <div class="controls">
                            <input type="text" class="span6 typeahead" id="typeahead" name="keyword" value="<?php echo $product['keyword'];?>">
                        </div>
                    </div>
					<div class="control-group">
                        <label class="control-label" for="typeahead">作品简介 </label>
                        <div class="controls">
                            <input type="text" class="span6 typeahead" id="typeahead" value="<?php echo $product['description']; ?>"  name="p[description]" >
                        </div>
                    </div>

                    <div class="control-group hidden-phone">
                        <label class="control-label" for="textarea2">作品详情</label>
                        <div class="controls">    
                            <textarea id="ueditor" class="required" name="p[content]"><?php echo $product['content']; ?></textarea> 
                        </div>
                    </div>

                    <div class="form-actions">
                        <input type="submit" value="修改"   id="submit" class="btn btn-primary" />
                      <input type="hidden" name="id" value="<?php echo $product['id']; ?>"/>
                    </div>
                </fieldset>
            </form>   
        </div>
    </div><!--/span-->

</div><!--/row-->
 <script type="text/javascript">
        $(document).ready(function(){
            $("#submit").click(function(){
                submitForm('#editForm',"<?php echo url('product'); ?>");   
            });
        });
    </script>
